package com.changhong.framework.sdfs.namenode.server.builder;

import com.changhong.framework.sdfs.namenode.server.config.DefaultNameNodeConfig;
import com.changhong.framework.sdfs.namenode.server.config.NameNodeConfig;
import com.changhong.framework.sdfs.namenode.server.context.DefaultNameNodeContext;
import com.changhong.framework.sdfs.namenode.server.context.NameNodeContext;
import com.changhong.framework.sdfs.namenode.server.directory.DefaultDirectoryManager;
import com.changhong.framework.sdfs.namenode.server.directory.DefaultFileManagerSystem;
import com.changhong.framework.sdfs.namenode.server.directory.DirectoryManager;
import com.changhong.framework.sdfs.namenode.server.directory.FileManagerSystem;
import com.changhong.framework.sdfs.namenode.server.nio.DoubleFlushManager;
import com.changhong.framework.sdfs.namenode.server.register.DataNodeRegistry;
import com.changhong.framework.sdfs.namenode.server.register.DefaultDataNodeRegistry;
import com.google.inject.AbstractModule;
import com.google.inject.Singleton;

/**
 * @author Summer
 */
public class NameNodeModules extends AbstractModule {
    @Override
    protected void configure() {
        bind(NameNodeConfig.class).to(DefaultNameNodeConfig.class).in(Singleton.class);
        bind(NameNodeContext.class).to(DefaultNameNodeContext.class).in(Singleton.class);
        bind(DoubleFlushManager.class).in(Singleton.class);
        bind(FileManagerSystem.class).to(DefaultFileManagerSystem.class).in(Singleton.class);
        bind(DirectoryManager.class).to(DefaultDirectoryManager.class).in(Singleton.class);
        bind(DataNodeRegistry.class).to(DefaultDataNodeRegistry.class).in(Singleton.class);
    }
}
